<?php


namespace app\admin\logic;

/**
 * 观察处理类
 * Class ObAction
 * @package app\admin\cache
 * @author Mr.Li
 * @create 2021-08-18 10:43
 */
class ObAction implements ObSubjectInterface
{

    public $_obService = [];

    public function addObService($key, ObService $obCache)
    {
        $this->_obService[$key] = $obCache;
    }

    public function removeObService($key)
    {
        unset($this->_obService[$key]);
    }

    public function notify($params)
    {
        foreach ($this->_obService as $obService) {
            $obService->notify($params);
        }
    }
}
